﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BneyBaruch.Ingest.Core.WorkflowCommunication.Tracking;
using System.Windows.Forms;

namespace BneyBaruch.Ingest.WorkflowMonitor
{
    public class WorkflowTrackingServiceCallback : IWorkflowTrackingServiceCallback
    {
        #region Fields

        private frmWorkflowMonitor _frmWorkflowMonitor = null;

        #endregion

        #region Constructors

        public WorkflowTrackingServiceCallback(frmWorkflowMonitor frmWorkflowMonitor)
        {
            _frmWorkflowMonitor = frmWorkflowMonitor;
        }

        #endregion

        #region IWorkflowTrackingServiceCallback Members

        public void NotifyTrackRecordEvent(WorkflowTrackRecordEvent workflowTrackRecordEvent)
        {
            string text = workflowTrackRecordEvent.Message;
            _frmWorkflowMonitor.notifyIcon1.ShowBalloonTip(5000, _frmWorkflowMonitor.notifyIcon1.BalloonTipTitle, text, ToolTipIcon.Info);

            _frmWorkflowMonitor.listViewWorkflowEvents.Items.Add(
                new ListViewItem(text));
        }

        #endregion
    }
}
